<%-- 
    Document   : viewuser
    Created on : Jul 31, 2014, 2:06:11 PM
    Author     : THANMINH
--%>

<%@page import="model.enetities.UserProfile"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>List User</title>
    </head>
    <body>
        <form action="/LUDWebsite/listAllUser" method="POST">
            <input type="submit" value="send">
        </form>
        <% List<UserProfile>  listusers = ( List<UserProfile> ) request.getAttribute("listuser") ; %>
        <% if(listusers != null) { %>
        <form action="listAllUser">
            <table border="1">
                <thead>
                    <tr>
                        <th>User Id</th>
                        <th>Full Name</th>
                        <th>Birth Day</th>
                        <th>Gender</th>
                        <th>Home Town</th>
                        <th>Mobile</th>
                        <th>Email</th>
                        <th>Facebook</th>                        
                    </tr>
                </thead>
                <tbody>
                    <% for(UserProfile user : listusers ){ %>
                    <tr>
                        <td><%= user.getIdUser() %></td>    
                        <td><%= user.getFullName() %> </td>
                        <td><%= user.getDateOfBirth() %></td>
                        <td><%= user.isGender() %></td>
                        <td><%= user.getHomeTown() %></td>
                        <td><%= user.getMobile() %></td>
                        <td><%= user.getEmail() %></td>
                        <td><%= user.getFacebookLink() %></td>                        
                        <td><a href="listAllUser?action=1&id=<%= user.getIdUser() %>">Edit</a></td>
                        <td><a href="listAllUser?action=2&id=<%= user.getIdUser() %>">Delete</a></td>
                    </tr>
                    <% } %>                    
                </tbody>
            </table>

        </form>
                    <% } %>
    </body>
</html>
